//
//  HomeTableView.m
//  BasePorject_App
//
//  Created by Yutian Duan on 2019/5/27.
//  Copyright © 2019年 Wanwin. All rights reserved.
//

#import "HomeTableView.h"
#import "HomeCell.h"

@implementation HomeTableView

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
  self = [super initWithFrame:frame style:style];
  if (self) {
    self.backgroundColor = HEXCOLOR(0xf7f8fc);

    self.rowHeight = (ScreenWidth - 40) * ITEMPRO + 10;
    [self hideLine];
  }
  return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  return self.data.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  static NSString *identify = @"HomeCell";
  
  HomeCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
  if (!cell) {
    cell = [[HomeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];
  }
  cell.model = self.data[indexPath.row];
  return cell;
}

@end
